<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Environment" rel="Chapter" href="Environment.html"><title>Environment</title>
</head>
<body>
<div class="navbar">&nbsp;<a href="index.html">Up</a>
&nbsp;</div>
<center><h1>Module <a href="type_Environment.html">Environment</a></h1></center>
<br>
<pre><span class="keyword">module</span> Environment: <code class="code">sig</code> <a href="Environment.html">..</a> <code class="code">end</code></pre>Environments (implemented with hashtables) and operations on them<br>
<b>Author(s):</b> Johannes Woolard<br>
<hr width="100%">
<br><code><span class="keyword">type</span> <a name="TYPEenv"></a><code class="type">('a, 'b)</code> env = {</code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>e_elems&nbsp;: <code class="type">('a, 'b) Hashtbl.t</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Contents of the environment</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>e_parent&nbsp;: <code class="type">('a, 'b) <a href="Environment.html#TYPEenv">env</a> Pervasives.ref option</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The parent of this environment</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>
}

<div class="info">
The type of Environments (ie. Heirarchical maps).<br>
</div>

<pre><span class="keyword">val</span> <a name="VALnew_env"></a>new_env : <code class="type">('a, 'b) <a href="Environment.html#TYPEenv">env</a> Pervasives.ref -> ('a, 'b) <a href="Environment.html#TYPEenv">env</a></code></pre><div class="info">
Create a new environment, with a given parent.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALempty_env"></a>empty_env : <code class="type">unit -> ('a, 'b) <a href="Environment.html#TYPEenv">env</a></code></pre><div class="info">
Get an empty environment with no parent<br>
</div>
<pre><span class="keyword">val</span> <a name="VALbind_env"></a>bind_env : <code class="type">('a, 'b) <a href="Environment.html#TYPEenv">env</a> Pervasives.ref -> 'a -> 'b -> unit</code></pre><div class="info">
<code class="code">bind_env e k v</code> binds the value <code class="code">v</code> to the variable <code class="code">k</code> in the current Environment (as opposed to any parent environment)<br>
</div>
<pre><span class="keyword">val</span> <a name="VALexists_env"></a>exists_env : <code class="type">('a, 'b) <a href="Environment.html#TYPEenv">env</a> Pervasives.ref -> 'a -> bool</code></pre><div class="info">
Tests if a variable name is bound in the current or any parent environment<br>
</div>
<pre><span class="keyword">val</span> <a name="VALget_env"></a>get_env : <code class="type">('a, 'b) <a href="Environment.html#TYPEenv">env</a> Pervasives.ref -> 'a -> 'b</code></pre><div class="info">
Gets the value of a variable from the environment or its parents<br>
<b>Raises</b> <code>Not_found</code> If the specified variable isn't found.<br>
</div>
</body></html>